import React, { Component } from 'react';
import { connect } from 'dva';
import styles from './index.less';

import { Spin, Icon, Skeleton } from 'antd';
import { getComplianceRank } from '@/services/evaluate';

const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;

// @connect(({ contentPage }) => ({
//   // detailInfo: contentPage.detailInfo,
// }))

class ContentPage extends Component {
  constructor(props) {
    super(props);
  }
  state = {
    spiner: true,
  };

  componentDidMount() {
    const { dispatch, contentID, SourceType } = this.props;
    console.log('SourceType', SourceType);
    dispatch({
      type: 'contentPage/getDetailInfo',
      payload: {
        id: contentID,
        api_type: SourceType,
      },
    });
  }

  componentWillReceiveProps() {}

  close = () => {
    console.log('close');
    this.setState({ spiner: false });
  };

  render() {
    let { detailInfo, dispatch, showDetail } = this.props;
    // dispatch({
    //   type: 'opwarning/getDetailInfo',
    //   payload: {
    //     id: '4719024_28_10008',
    //     api_type: 'wealth_knows',
    //   },
    // });

    return (
      // <div className={styles.ContentPage}>
      <div className={styles.contentBox}>
        {/* <Spin indicator={antIcon} spinning={this.state.spiner}> */}
        {/* <div className={styles.closeBtn}></div> */}
        {/* <Icon className={styles.closeBtn} type="close-square" onClick={this.close} /> */}
        <div className={styles.content}>
          <Skeleton loading={this.state.spiner} style={{ height: '100%' }} active />
        </div>
        {/* <p style={{ color:'#000', fontSize:'24px', textAlign:'center', lineHeight:'80vh' }}>详情页内容</p> */}
        {/* </Spin> */}
      </div>
      // </div>
    );
  }
}

export default ContentPage;
